//
//  MHChangeNickViewController.m
//  ManHua
//
//  Created by 江子安 on 15/11/2.
//  Copyright © 2015年 蓝欧科技. All rights reserved.
//

#import "MHChangeNickViewController.h"

@interface MHChangeNickViewController ()<UITextFieldDelegate>


@property (nonatomic, strong) UITextField *nickTF;

@end

@implementation MHChangeNickViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"昵称";
    self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:kThemeColor,UITextAttributeTextColor,nil];
    
   
  
    
    self.nickTF = [[UITextField alloc]initWithFrame:CGRectMake(10, 94, Width - 20, 44)];
    _nickTF.text = self.userInfo.UserNick;
    _nickTF.borderStyle = UITextBorderStyleRoundedRect;
    _nickTF.delegate = self;
    _nickTF.backgroundColor = [UIColor whiteColor];
    _nickTF.clearButtonMode = UITextFieldViewModeWhileEditing;
    [_nickTF addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
    [self.view addSubview:_nickTF];
    
}

- (void) textFieldDidChange:(id) sender {
    UITextField *textField = (UITextField *)sender;
    _nick = textField.text;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
